package demo7;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        System.out.println("正在初始化Spring容器....");
        AnnotationConfigApplicationContext context
                = new AnnotationConfigApplicationContext("demo7");
        System.out.println("Spring容器初始化完毕...");
        Person person = context.getBean(Person.class);
        person.sayHello();

        System.out.println("正在销毁Spring容器...");
        context.close();
        System.out.println("Spring容器销毁完毕...");

    }

}
